/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exercises.day01.pt1;

import java.util.Scanner;

/**
 * MyFirstJava
 *
 * @author (jaice)
 * @version 0.1 (may 28, 2012)
 * 
 *c. Write a program that prompts the user for two numbers, then prints
 *	i.   The sum 				num1+num2
 *	ii.  The difference			num1-num2
 *	iii. The product			num1*num2
 *	iv.  The average			(num1+num2)/2
 *	v.   The distance (absolute value of the difference) Math.abs(num1-num2)
 *	vi.  The maximum (the larger of the two)	if(num1>num2) else 
 *	vii. The minimum (the smaller of the two)
 *
 * 
 */
public class TwoNumberFunctions {

    public static void main(String args[]) {
        //declare variable
        int num1 = 0; 
        int  num2 = 0;

        //declare scanner
        Scanner sc = new Scanner(System.in);

        //print input num1
        System.out.println("Input first integer ");
        //get input num1
        num1 = sc.nextInt();

        //print input num2
        System.out.println("Input second integer ");
        //get input num2
        num2 = sc.nextInt();

        //prints sum
        System.out.println("\n\nThe sum is " + (num1 + num2));

        //prints difference
        System.out.println("The difference is " + (num1 - num2));

        //prints product
        System.out.println("The product is " + (num1 * num2));

        //prints ave
        System.out.println("The average is " + (float) (num1 + num2) / 2);

        //prints distance
        System.out.println("The distance is " + Math.abs(num1 - num2));

        //checks if equal
        if (num1 == num2) {
            System.out.println(num1 + " is equal to " + num2);            
        } else if (num1 > num2) {//checks if num1 is larger than num2
            System.out.println("The maximum is " + num1);
            System.out.println("The minimum is " + num2);
        } else { //num2 is bigger than num1
            System.out.println("The maximum is " + num2);
            System.out.println("The minimum is " + num1);
        }




    }
}
